package com.weim.weim.controller;

import com.alibaba.fastjson.JSONObject;
import com.weim.weim.base.ApiResponse;
import com.weim.weim.entity.WxMiniParam;
import com.weim.weim.service.IWxMiniService;
import com.weim.weim.util.FaceDetectionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wxMini")
public class WxMiniController {
    @Autowired
    IWxMiniService wxMiniService;

    /**
     * 小程序免密登录
     * @return 账号信息
     */
    @PostMapping("/login")
    public ApiResponse<JSONObject> login(@Validated @RequestBody WxMiniParam wxMiniParam) {
        return wxMiniService.login(wxMiniParam);
    }
}
